#import "Entity.h";

@implementation Entity
@synthesize ai,name,classname,type,weapon ;
@synthesize move,movement ;
@synthesize strength,precision,reflexes,endurance,speed,willpower,range,faction,backstab,f,responsive;
@synthesize portrait;
@synthesize item1, item2, item3, item4,sprite;

-(id)initWithDictionary:(NSMutableDictionary*)dic {
	[super initWithDictionary:dic];
	self.name		= [dic objectForKey:@"name"];
	self.classname = [dic objectForKey:@"class"];
	self.type         = [dic objectForKey:@"type"];
	self.strength = [[dic objectForKey:@"strength"] intValue];
	self.precision = [[dic objectForKey:@"precision"] intValue];
	self.reflexes = [[dic objectForKey:@"reflexes"] intValue];
	self.endurance = [[dic objectForKey:@"endurance"] intValue];
	self.speed = [[dic objectForKey:@"speed"] intValue];
	self.willpower = [[dic objectForKey:@"willpower"] intValue];
	self.ai = [[dic objectForKey:@"ai"] intValue];
	self.sprite =[[dic objectForKey:@"sprite"] intValue]; 
	return self;
  }
-(void) drawRect:(CGRect)rect	{
	//[super drawRect:rect];
	UIImage*img =[self.set getImage:(sprite*5)+movement+move];
	[img drawInRect:rect];
		if(move==0)
			move=5;
		else 
			move=0;
	
}
@end
